﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="CompanyList.aspx.cs" Inherits="Company_CompanyList" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
    <script type="text/javascript" src="../My97DatePicker/WdatePicker.js"></script>
    <link href="../My97DatePicker/skin/WdatePicker.css" type="text/css" rel="Stylesheet" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">   
    <h2>
        公司资料
    </h2>
    <div class="searchcondition">
        <table class="searchtb">
            <tr>
                <td style="width: 15%">
                    报单日期（开始）
                </td>
                <td>
                    <asp:TextBox ID="OrderStart" runat="server" onfocus="WdatePicker()" CssClass="Wdate"></asp:TextBox>
                </td>
                <td style="width: 15%">
                    报单日期（终止）
                </td>
                <td>
                    <asp:TextBox ID="OrderEnd" runat="server" onfocus="WdatePicker()" CssClass="Wdate"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    公司编号
                </td>
                <td>
                    <asp:TextBox ID="CompanyID" runat="server"></asp:TextBox>
                </td>
                <td>
                    公司英文名
                </td>
                <td>
                    <asp:TextBox ID="EnglishName" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    公司中文名
                </td>
                <td>
                    <asp:TextBox ID="ChineseName" runat="server"></asp:TextBox>
                </td>
                <td>
                    注册地
                </td>
                <td>
                    <asp:DropDownList ID="DropDownList1" runat="server" AppendDataBoundItems="True" DataSourceID="SqlDataSource1"
                        DataTextField="RegionName" DataValueField="RegionID">
                        <asp:ListItem Value="999">--请选择--</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
        </table>
        <div>
            <asp:Button ID="Button1" runat="server" Text="查询" CssClass="searchbutton" OnClick="Button1_Click" /></div>
    </div>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CssClass="commongv"
        OnRowCommand="GridView1_RowCommand">
        <Columns>
            <asp:BoundField DataField="公司编号" HeaderText="公司编号" SortExpression="公司编号" />
            <asp:HyperLinkField DataNavigateUrlFields="companyserialnumber" DataNavigateUrlFormatString="~/Company/CompanyInfo.aspx?ID={0}"
                DataTextField="公司英文名" HeaderText="公司英文名" />
            <asp:BoundField DataField="公司中文名" HeaderText="公司中文名" SortExpression="公司中文名" />
            <asp:BoundField DataField="注册地" HeaderText="注册地" SortExpression="注册地" />
            <asp:BoundField DataField="董事长" HeaderText="董事长" SortExpression="董事长" />
            <asp:BoundField DataField="注册股份" HeaderText="注册股份" SortExpression="注册股份" />
            <asp:BoundField DataField="注册日期" HeaderText="注册日期" SortExpression="注册日期" DataFormatString="{0:yyyy-MM-dd}" />
            <asp:HyperLinkField Text="编辑" DataNavigateUrlFields="companyserialnumber" DataNavigateUrlFormatString="~/Company/EditCompany.aspx?ID={0}" />
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:LinkButton ID="LinkButton1" runat="server" OnClientClick="return confirm('你确认要删除这个公司吗？');"
                        CommandName="RemoveCompany" CommandArgument='<%# Bind("companyserialnumber")%>'>删除</asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <webdiyer:AspNetPager ID="AspNetPager1" runat="server" Width="100%" NumericButtonCount="6"
        UrlPaging="true" NumericButtonTextFormatString="[{0}]" CustomInfoHTML="共找到<b>%RecordCount%</b>条记录，现为第 <font color='red'><b>%CurrentPageIndex%</b></font> 页 共 %PageCount% 页 显示 %StartRecordIndex%-%EndRecordIndex% 条"
        ShowCustomInfoSection="left" Font-Names="Arial" BackColor="#FFFFFF" AlwaysShow="true"
        ShowInputBox="Always" SubmitButtonText="跳转" SubmitButtonStyle="botton" OnPageChanged="AspNetPager1_PageChanged"
        CssClass="mypager">
    </webdiyer:AspNetPager>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:KOONCRMDB %>"
        SelectCommand="SELECT RegionID, RegionName FROM Region order by regionid"></asp:SqlDataSource>
</asp:Content>
